import request from '@/config/axios'

// 心理测评题库 VO
export interface PsychQuestionBankVO {
  id: number // 主键
  title: string // 标题
  riskLevel: string // 题库类型（字典表：business_psych_question_bank_type）
  extractCount: number // 提取题目数
}

// 心理测评题库 API
export const PsychQuestionBankApi = {
  // 查询心理测评题库分页
  getPsychQuestionBankPage: async (params: any) => {
    return await request.get({ url: `/business/psych-question-bank/page`, params })
  },

  // 查询心理测评题库详情
  getPsychQuestionBank: async (id: number) => {
    return await request.get({ url: `/business/psych-question-bank/get?id=` + id })
  },

  // 查询心理测评题库详情
  getPsychQuestionBankAll: async () => {
    return await request.get({ url: `/business/psych-question-bank/list` })
  },

  // 新增心理测评题库
  createPsychQuestionBank: async (data: PsychQuestionBankVO) => {
    return await request.post({ url: `/business/psych-question-bank/create`, data })
  },

  // 修改心理测评题库
  updatePsychQuestionBank: async (data: PsychQuestionBankVO) => {
    return await request.put({ url: `/business/psych-question-bank/update`, data })
  },

  // 删除心理测评题库
  deletePsychQuestionBank: async (id: number) => {
    return await request.delete({ url: `/business/psych-question-bank/delete?id=` + id })
  },

  // 导出心理测评题库 Excel
  exportPsychQuestionBank: async (params) => {
    return await request.download({ url: `/business/psych-question-bank/export-excel`, params })
  },
}
